﻿@model DeliveryManage.Model.Sys_Navigation
@{
    Layout = null;
    DeliveryManage.Models.ReturnMsgModel returnMsg = ViewBag.ReturnMsgModel;
}

<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>编辑父级菜单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="~/Content/font.css" />
    <link rel="stylesheet" href="~/Content/framemain.css" />
    <link rel="stylesheet" href="~/Content/icon/iconfont.css" />
    <link rel="stylesheet" href="~/Content/style.css" />
    <script type="text/javascript" src="~/Scripts/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="~/Content/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="~/Scripts/framemain.js"></script>
    <script type="text/javascript" src="~/Scripts/laymain.js"></script>
    <script type="text/javascript" src="~/Scripts/common.js"></script>
    <script type="text/javascript" src="~/Scripts/Validform_v5.3.2_min.js"></script>

    <style>
        .editor {
            margin: 0px;
            width: 436px;
            height: 339px;
        }

        .check {
            width: 100px !important
        }
    </style>
    <script type="text/javascript">
        $(function () {
            //操作提示
            if (@returnMsg.code == 400) {
                layer.msg('@returnMsg.msg', { icon: 5, title: '提示' }, function (index) {
                  layer.close();
                })
            }
            $(document).ready(function () {
                $("#myfrom").submit(function () {
                    var data = $(this).serialize();
                    layer.confirm('确认提交吗?', { icon: 3, title: '提示' }, function (index) {
                        $.ajax({
                            type: "POST",
                            url: "/System/SysParentEdit",
                            data: data,
                            success: function (obj) {
                                if (obj.status == true) {
                                    layer.msg(obj.msg, { icon: 6, title: '提示' }, function (index) {
                                        window.parent.window.location.href = '/System/SysNavigation';
                                    });
                                } else {
                                    layer.msg(obj.msg, { icon: 5, title: '提示' }, function (index) {
                                        layer.close();
                                        location.reload();
                                    });
                                }
                            }
                        })
                        layer.close();
                    });
                    return false;

                })
            })
        });
    </script>
</head>
<body>
    <form id="myfrom">

        @{
            if (returnMsg.code == 200)
            {
                @Html.HiddenFor(m => m.id)
                @Html.Hidden("AddOrEdit", (string)ViewBag.AddOrEdit)
                <div class="tab-content">
                    <dl>
                        <dt><span class="Validform_checktip">*</span>视图名称</dt>
                        <dd>
                            @Html.TextBoxFor(m => m.name, new { @datatype = "s2-100", @class = "input normal", @sucmsg = " " })
                            <span class="Validform_checktip">*视图名称首字母大写</span>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="Validform_checktip">*</span>父级菜单</dt>
                        <dd>
                            @Html.TextBoxFor(m => m.title, new { @datatype = "s2-100", @class = "input normal", @sucmsg = " " })
                            <span class="Validform_checktip">*下级菜单不能超过4个字符</span>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="Validform_checktip">*</span>Icon图标</dt>
                        <dd>
                            @Html.TextBoxFor(m => m.icon, new { @datatype = "s2-100", @class = "input normal", @sucmsg = " " })
                            <span class="Validform_checktip">
                                *Icon菜单图标，如：layui-icon-user<br />
                                <a title="是否点击进入Icon图标库参考" target="_blank" href="http://www.shagua.wiki/project/3?p=85">参考；http://www.shagua.wiki/project/3?p=85 </a>
                            </span>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="Validform_checktip">*</span>排序</dt>
                        <dd>
                            @Html.TextBoxFor(m => m.sort_id, new { @class = "input normal" })
                            <span class="Validform_checktip">*排序只能输入数字类型</span>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="Validform_checktip">*</span>操作权限</dt>
                        <dd>
                            <div class="multi-checkbox">
                                <table class="layui-form">
                                    <tr>
                                        <td class="check"><input type="checkbox" name="Show" lay-skin="primary" class="checkall" @((string)ViewBag.Show == "Show" ? " checked=\"checked\"" : "") /><label>查看</label></td>
                                    </tr>
                                </table>
                            </div>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="Validform_checktip">*</span>开放状态</dt>
                        <dd>
                            <div class="layui-form">
                                <input type="radio" name="is_lock" value="0" @(Model.is_lock == 0 ? "checked=\"checked\"" : "") />开放
                                <input type="radio" name="is_lock" value="1" @(Model.is_lock == 1 ? "checked=\"checked\"" : "") />关闭
                                <span class="Validform_checktip">是否开放显示状态，默认关闭</span>
                            </div>
                        </dd>
                    </dl>
                    <div class="layui-form-item">
                        <input id="btnSubmit" name="btnSubmit" type="submit" value="保存信息" class="layui-btn" />
                    </div>
                </div>
            }
        }
        <script>
            layui.use(['form', 'layer'],
                function () {
                    $ = layui.jquery;
                    var form = layui.form,
                        layer = layui.layer;
                });
        </script>
    </form>
</body>
</html>
